// index.js
const textInput = document.getElementById('text-input');
const counter = document.getElementById('counter');

textInput.addEventListener('input', () => {
    const text = textInput.value.trim();
    const count = text.length;
    counter.textContent = `${count} 字`;
});